/**
 * 批阅意见
 */
var localStorageManagers = require("script/localStorageManagers.js");
//mui初始化
mui.init({
	swipeBack:true
});
//plus初始化
mui.plusReady(function(){
	plusReady();
});
//plusReady
function plusReady(){
	loadNoteview();
};
//加载批阅数据
function loadNoteview(){
	document.getElementById('queslist').innerHTML=' ';
	ajaxLoadNoteview();
};
//ajax加载
function ajaxLoadNoteview(){
	var userid=localStorageManagers.getUseridSession();
	var catalogid=plus.webview.currentWebview().catalogid;
	var url=serverAjax+"/mobile/note/getNoteviewListByCatalogid.do"
	mui.ajax(url,{
		data:{userid:userid,catalogid:catalogid},
		type:'post',
		dataType:'json',
		success:function(data){
			if(data==null||data.length==0)return;
			buildNoteviewDiv(data);
			mui('.elseinfo').imageLazyload({
				placeholder: '../../images/user_guest.png'
			});
		},
		error:function(e1,e2,e3){
			ajaxErrorTip();
			console.log(e1);
		}
	});
};
//buildNoteviewDiv
function buildNoteviewDiv(data){
	var notesEle=document.getElementById('queslist');
	for(var i=0;i<data.length;i++){
		var notestr='<div class="quesitem">'
						+'<div class="elseinfo">'
						+'<span class="userimg"><img  data-lazyload="'+data[i].userpath+'"></span>'
							+'<p class="p1"><span class="c1">'+data[i].creator+'(老师)</span></p>'
							+'<p class="p2"><span class="c4">'+data[i].noteDate+'</span></p>'
						+'</div>'
						+'<div class="content-value">'+data[i].viewContent+'</div>'
					+'</div>';
					notesEle.innerHTML=notesEle.innerHTML+notestr;
	}
}
